home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Apr 90 / MacApp.Tech$ 4⁄13⁄90 / 1089-Re Dimming TEditText-Apr90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.1 KB  |  72 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    4110420                         12-April-90        13:08PDT
  4.  
  5. From:   POWERUP.ENG                     Power Up Software,PRT
  6.  
  7. To:     D3085                           Progressive Computing, D Lucky,PRT
  8.         MACAPP.TECH$                    MacApp Technical
  9.  
  10. Sub:    RE>Dimming TEditText fiel
  11.  
  12. Attn: Progressive Computing, D Lucky
  13. Attn:   MacApp.Tech$
  14. SentBy: James Plamondon
  15. Date   4/5/90
  16. Subject    RE>Dimming TEditText fields
  17. From   James Plamondon
  18. To Progressive Computing, D Lucky
  19. CC   MacApp.Tech$
  20.  
  21. Reply to:  RE>Dimming TEditText fields
  22. Dave,
  23.  
  24. My quick response is as follows:
  25.  
  26. You can't do the obvious overrides of ViewEnable(), DimState(), and Dim(), in
  27. which each calls the other, because you'll fall into an infinite loop:
  28.  
  29. PROCEDURE TYourEditText.ViewEnable(state, redraw: BOOLEAN);
  30. BEGIN
  31. INHERITED ViewEnable(state, kDontRedraw);
  32. DimState(NOT state, redraw);
  33. END;
  34.  
  35. PROCEDURE TYourEditText.DimState(state, redraw: BOOLEAN);
  36. BEGIN
  37. INHERITED DimState(state, kDontRedraw);
  38. ViewEnable(NOT state, redraw);
  39. END;
  40.  
  41. You could do it if you could revise the code as follows:
  42.  
  43. PROCEDURE TYourEditText.ViewEnable(state, redraw: BOOLEAN);
  44. BEGIN
  45. INHERITED ViewEnable(state, kDontRedraw);
  46. INHERITED DimState(NOT state, redraw);
  47. END;
  48.  
  49. PROCEDURE TYourEditText.DimState(state, redraw: BOOLEAN);
  50. BEGIN
  51. INHERITED DimState(state, kDontRedraw);
  52. INHERITED ViewEnable(NOT state, redraw);
  53. END;
  54.  
  55. …but I don't know if that will work — calling INHERITED ProcName() from some
  56. method other than ProcName() may be disallowed, seems kinda weird if it is
  57. allowed, and makes me wonder exactly what version of ProcName() you'd end up
  58. calling if it were allowed.
  59.  
  60. The quick-and-dirty alternative is to write a new method, called
  61. SetAccessState(state), which calls both ViewEnable(state) and DimState(NOT
  62. state), and call this anywhere you would otherwise call ViewEnable() or
  63. DimState().  This doesn't help in those cases where the system calls these
  64. routines, however.
  65.  
  66. Looking forward to an instance variable in TControl called fDimOnDisable, I am
  67.  
  68. Yours,
  69.  
  70. James Plamondon
  71.  
  72.